﻿Namespace EIBData.DPT
    Public NotInheritable Class EIBDataDPT_9_008
        Inherits EIBDataDPT_9_Base


        Sub New(data As Byte())
            MyBase.New(data)

            If _value < 0 Then Throw New EIB.Exceptions.EIBDataDecodeException("")
            If _value > 670760 Then Throw New EIB.Exceptions.EIBDataDecodeException("")
        End Sub

        Sub New(value As Double)
            MyBase.New(value)

            If value < 0 Then Throw New EIB.Exceptions.EIBDataEncodeException("")
            If value > 670760 Then Throw New EIB.Exceptions.EIBDataEncodeException("")
        End Sub


        Public Shared Shadows ReadOnly Property DPT_Name As String
            Get
                Return "DPT_Value_AirQuality"
            End Get
        End Property

        Public Shared Shadows ReadOnly Property DPT_Number As String
            Get
                Return "9.008"
            End Get
        End Property

        Public Overrides Function ToString() As String
            Return String.Format("{0:F2} ppm", _value)
        End Function
    End Class
End Namespace